package com.example.mygrade.webapi;

import com.example.mygrade.core.RUtil;
import com.example.mygrade.domain.Student;
import com.example.mygrade.service.StudentService;
import com.example.mygrade.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/api/login")
public class LoginApiController {
    @Autowired
    private StudentService studentService;

    @GetMapping("/student")
    public R student(String name, String sno) throws Exception{
        List<Student> student = studentService.findBySnameAndSno(name,sno);
        return RUtil.success(student,"登录成功");
    }
}
